<* include file=$header_file *>
<script type="text/JavaScript">
	if(parent.$('admincpnav')) parent.$('admincpnav').innerHTML='<* $title*>&nbsp;&raquo;&nbsp;Index';if(parent.$('add2custom')) parent.$('add2custom').innerHTML='<* $title*>';
</script>
<div class="itemtitle">
    <input  type="button" value="  Refresh " class="btn" onClick="window.location.reload()"/>&nbsp;<input  type="button" value="  Add " class="btn" onClick="window.location.href='/<*$controller*>/add'"/>
  </h3>
</div>
<div id="main_content"> <* $page *>
	<table class="tb tb2 ">
    <tr class="tdhover" >
		<th class="partition">Contact_ID</th>
		<th class="partition">Contact_Date</th>
		<th class="partition">Contact_Type</th>
		<th class="partition">Contact_Method</th>    
		<th class="partition">Contact_Source</th>
		<th class="partition">Client_Postcode</th>
		<th class="partition">Client_Gender</th>
      <!--<th class="partition">Contact_Referred_By</th>
      <th class="partition">Contact_Referred_To</th>-->
      <th class="partition">Function</th>	  
    </tr>
    <* foreach from=$result item=item key=key *>
    <tr  class="tdhover">
		<td ><* $item.Contact_ID *></td>
		<td ><* $item.Contact_Date *></td>
		<td ><* $item.Contact_Type  *></td>
		<td ><* $item.Contact_Method  *></td>
		<td ><* $item.Contact_Source *></td>
		<td ><* $item.Client_Postcode *></td>
        <td ><* $item.Client_Gender *></td>
      <!--<td ><* $item.Contact_Referred_By *></td>
      <td ><* $item.Contact_Referred_To *></td>	--> 
      <td ><a href="javascript:edit(<*$item.Contact_ID*>)">Edit</a> | <a href="javascript:deleteit(<*$item.Contact_ID*>)">Delete</a></td>
    </tr>
    <* /foreach*>
  </table>
  <* $page *> </div>
<script type="text/javascript">

function edit(Contact_ID)
{
   window.location='/<*$controller*>/edit/Contact_ID/'+Contact_ID;
}

function deleteit(Contact_ID)
{
  if(confirm("Really deleted this record?")){
   window.location='/<*$controller*>/delete/Contact_ID/'+Contact_ID;
  }
}

</script>
<* include file=$bottom_file *>